import Vue from 'vue'
import Router from 'vue-router'
// import Hello from '@/components/Hello'
// import World from '@/components/World'
// import See from '@/components/See'
// import You from '@/components/You'
Vue.use(Router)
// const Main = r => require.ensure([], () => r(require('../components/Main.vue')), 'Main')
const home = r => require.ensure([], () => r(require('../components/home/home.vue')), 'home')
const shop = r => require.ensure([], () => r(require('../components/shop/shop.vue')), 'shop')
const information = r => require.ensure([], () => r(require('../components/information/information.vue')), 'information')
const my = r => require.ensure([], () => r(require('../components/my/my.vue')), 'my')
const login = r => require.ensure([], () => r(require('../components/my/children/login.vue')), 'login')
const register = r => require.ensure([], () => r(require('../components/my/children/register.vue')), 'register')
const forget = r => require.ensure([], () => r(require('../components/my/children/children/forget.vue')), 'forget')
// const account = r => require.ensure([], () => r(require('../components/my/children/children/account.vue')), 'account')
const search = r => require.ensure([], () => r(require('../components/home/children/search.vue')), 'search')
const half = r => require.ensure([], () => r(require('../components/home/children/halfCover.vue')), 'half')
const shopDetail = r => require.ensure([], () => r(require('../components/home/children/shopDetail.vue')), 'shopDetail')
const more = r => require.ensure([], () => r(require('../components/home/children/more.vue')), 'more')
const chen = r => require.ensure([], () => r(require('../components/children/chen.vue')), 'chen')
const yi = r => require.ensure([], () => r(require('../components/children/yi.vue')), 'yi')
const xun = r => require.ensure([], () => r(require('../components/children/xun.vue')), 'xun')

export default new Router({
  routes: [
    {
      path: '',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children: [
        {
          path: '/half',
          name: 'half',
          component: half
        },
        {
          path: '/more',
          name: 'more',
          component: more
        },
        {
          path: '/shopDetail',
          name: 'shopDetail',
          component: shopDetail
        },

      ]
    },
    {
      path: '/search',
      name: 'search',
      component: search
    },
    {
      path: '/shop',
      name: 'shop',
      component: shop,
      children: [{
        path: '/chen',
        name: 'chen',
        component: chen
      }]
    },
    {
      path: '/information',
      name: 'information',
      component: information,
      children: [{
        path: '/yi',
        name: 'yi',
        component: yi
      }]
    },
    {
      path: '/my',
      name: 'my',
      component: my,
      children: [
        {
          path: '/xun',
          name: 'xun',
          component: xun
        },
        {
          path: '/login',
          name: 'login',
          component: login,
          children: [
            {
              path: '/forget',
              name: 'forget',
              component: forget
            },
            {
              path: '/register',
              name: 'register',
              component: register,
            },
          ]
        },
        {
          path: '/register',
          name: 'register',
          component: register,
        },
      ]
    }
  ]
})
